Returns the first element of an enumeration.
Use the method to obtain the first element of an enumeration. The method throws an exception if the enumeration contains no elements. To instead return nil when the enumeration is empty, use the FirstOrDefault method.